<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
<div th:replace="~{fragments/header :: header}">...</div>
<div th:if="${message}">
    <h2 th:text="${message}"/>
</div>
<div>
    <form method="POST" enctype="multipart/form-data" action="/view/upload">
        <table>
            <tr>
                <td>File to upload:</td>
                <td><input type="file" name="file"/></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" value="上传"/></td>
            </tr>
        </table>

    </form>
</div>

<div>
    <table border="1">
        <thead>
        <tr>

            <td>Name(名称)</td>
            <td>ID（编号）</td>
            <td>contentType（内容类型）</td>
            <td>size（大小 单位：bytes）</td>
            <td>uploadDate（上传时间）</td>
            <td>md5（摘要信息）</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        <tr th:if="${files.size()} eq 0">
            <td colspan="3">没有文件信息！！</td>
        </tr>
        <tr th:each="file : ${files}">
            <td><a th:href="'files/'+${file.id}"><span th:text="${file.name}"></span></a></td>
            <td th:text="${file.id}"></td>
            <td th:text="${file.contentType}"></td>
            <td th:text="${file.size}"></td>
            <td th:text="${file.uploadDate}"></td>
            <td th:text="${file.md5}"></td>
            <td>
                <a th:href="'view/'+${file.id}" th:target="_blank">查看</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<div th:replace="~{fragments/footer :: footer}">...</div>
</body>
</html>
